﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Smarts.Core;
using Smarts.Controls;
using Smarts.Sequences;

namespace Smarts.Showcase
{
    public partial class Showcase : Form
    {
        public Showcase()
        {
            InitializeComponent();
        }

        public CollectionManagerProxy<int> colManagerProxy;

        private void CompareStrings(object sender, EventArgs e)
        {
            StringSimilarity comparison = new StringSimilarity(
                stringComparerString1.Text, stringComparerString2.Text);
            stringComparerStringsAreEqual.Value = comparison.Equal;
            stringComparerString1ContainsString2.Value = comparison.String1ContainsString2;
            stringComparerString2ContainsString1.Value = comparison.String2ContainsString1;
            stringComparerStringsDifferByCaseOnly.Value = comparison.DifferByCaseOnly;
            stringComparerStringsDifferByWhiteSpaceOnly.Value = comparison.DifferByWhiteSpaceOnly;
        }

        private void pluralizeShowResults_Click(object sender, EventArgs e)
        {
            pluralizeSingularForm.Text = Plural.Of(1, pluralizeSource.Text);
            pluralizePluralForm.Text = Plural.Of(2, pluralizeSource.Text);
        }

        private void Showcase_Load(object sender, EventArgs e)
        {
            colManagerProxy = new CollectionManagerProxy<int>(collectionManagerDemo);
            colManagerProxy.Items = Integers.From(1).To(10).ToList();
        }

        private void AddToCollectionManager()
        {
            colManagerProxy.Add(colManagerProxy.Items.Max() + 1);
        }
    }
}
